/*
 * @文件描述:
 * @公司: 山东大学信息学院
 * @作者: 李洪文
 * @LastEditors: 李洪文
 * @LastEditTime: 2019-11-10 16:19:43
 */

import { Dimensions, Platform, PixelRatio } from 'react-native';

const DEVICE_WIDTH = Dimensions.get('window').width;
const DEVICE_HEIGHT = Dimensions.get('window').height;
const STATUSBAR_HEIGHT = Platform.OS === 'ios' ? 20 : 0;

const uiPageWidth = 375;

const px = (uiPx: number) => (uiPx * DEVICE_WIDTH) / uiPageWidth;

// 路由导航栏的高度
const NAV_HEADER_HEIGHT = px(50) + STATUSBAR_HEIGHT;

// 可放置内容的高度 不包含状态栏和导航栏
const CONTENT_HEIGHT = DEVICE_HEIGHT - NAV_HEADER_HEIGHT;

export default {
  px,
  DEVICE_WIDTH,
  DEVICE_HEIGHT,
  STATUSBAR_HEIGHT,
  ONE_PIXEL: 1 / PixelRatio.get(),
  NAV_HEADER_HEIGHT,
  CONTENT_HEIGHT,
  DRAWER_WIDTH: 250,
  FORM_ITEM_RIGHT_ICON: 18,
  FORM_ITEM_RECOMMEND_ICON: 25,
};
